(function() {
  var $, DashboardController, TomatoBreak, changePage, createController;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
  TomatoBreak = this.TomatoBreak;
  $ = jQuery;
  createController = TomatoBreak.ControllerFactory.create;
  changePage = TomatoBreak.changePage;
  DashboardController = (function() {
    __extends(DashboardController, Spine.Controller);
    DashboardController.elements = {
      '#todo-list': 'todoList',
      '#activity-sheet': 'activitySheet',
      '#new-task': 'newTask',
      '#edit-task': 'editTask',
      '#reports': 'reports',
      '#settings': 'settings'
    };
    function DashboardController() {
      DashboardController.__super__.constructor.apply(this, arguments);
      createController(this.todoList, TomatoBreak.ToDoItemsController);
      createController(this.activitySheet, TomatoBreak.TasksController);
      createController(this.newTask, TomatoBreak.TaskController);
      createController(this.editTask, TomatoBreak.TaskController);
      createController(this.reports, TomatoBreak.ReportsController);
      createController(this.settings, TomatoBreak.SettingsController);
      this.routes({
        '!/settings': __bind(function() {
          return changePage(this.settings);
        }, this),
        '!/reports': __bind(function() {
          return changePage(this.reports);
        }, this),
        '!/tasks/:id/edit': __bind(function(params) {
          (this.editTask.data('controller')).change(params.id);
          return changePage(this.editTask);
        }, this),
        '!/tasks/new': __bind(function() {
          return changePage(this.newTask);
        }, this),
        '!/tasks': __bind(function() {
          return changePage(this.activitySheet);
        }, this),
        '': __bind(function() {
          return changePage(this.todoList);
        }, this)
      });
      Spine.Route.setup();
    }
    return DashboardController;
  })();
  $(function() {
    return new DashboardController({
      el: $('#main')
    });
  });
}).call(this);
